import { Publicize } from "@/api/service/publicize/types";
import { DeviceTypeEnum, ScheduleTypeEnum } from "@/enum/system.enum";
import { getTimeZone } from "@/utils/utils";

export const showForm = ref(false);

const formObj: Publicize = {
  name: "",
  publicizeSize: "800*450",
  materials: [],
  objects: [],
  publishTime: [],
  timeZone: getTimeZone(),
  publishStatus: "0",
  timeType: ScheduleTypeEnum.ONE_TIME,
  type: DeviceTypeEnum.CUSTOM,
  week: []
};
export const form = ref<Publicize>({
  ...formObj
});

export const resetForm = () => {
  formObj.materials = [];
  formObj.publishTime = [];
  form.value = {
    ...formObj
  };
};
